import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

export const usePathStore = defineStore('path', () => {
  const calcPath = computed(() => {
    return sessionStorage.getItem('menuPath') ? JSON.parse(sessionStorage.getItem('menuPath')) : [];
  })
  const path = ref(calcPath.value);
  function setPath(newPath) {
    path.value = newPath;
  };
  return { path, setPath };
});
